<?php

declare(strict_types=1);

namespace filesystem\driver;

use League\Flysystem\FilesystemAdapter;
use filesystem\traits\Storage;
use Overtrue\Flysystem\Qiniu\QiniuAdapter;
use think\filesystem\Driver;
/**
 * Class Qiniu
 * @package filesystem\driver
 */
class Qiniu extends Driver
{
  use Storage;

  /**
   * @return FilesystemAdapter
   */
  protected function createAdapter(): FilesystemAdapter
  {
    // $this->config['domain']  or with protocol: https://xxxx.bkt.clouddn.com
    return new QiniuAdapter($this->config['accessKey'], $this->config['secretKey'], $this->config['bucket'], $this->config['domain']);
  }
}
